import Vue from 'vue'
import Router from 'vue-router'
import Login from '../View/Login'
import ChatView from '../View/ChatView'
import FriendList from '../View/FriendList'
import GroupChatList from '../View/GroupChatList'
import HandleInfo from '../View/HandleInfo'
// import ChatHome from '../components/ChatHome'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/Login',
    },
    {
      path: '/Login',
      name:"Login",
      component: Login,
    },
    {
      path: '/chatView',
      name: 'chatView',
      component: ChatView,
      meta: {
        requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
      },
      children: [
        {
          path: '/friendList',
          name: 'friendList',
          component: FriendList,
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
        },
        {
          path: '/groupChatList',
          name: 'groupChatList',
          component: GroupChatList,
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
        },
        {
          path: '/handleInfo',
          name: 'handleInfo',
          component: HandleInfo,
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
        },
      ]
    },
  ]
})
